﻿<?php
$servername = "localhost";
$username = "root";
$password = "";


try {
	
    $conn = new PDO("mysql:host=localhost;dbname=model", $username, $password);
    // 设置 PDO 错误模式为异常
    $sql = "SELECT ID FROM userlogin where ID ='1' ";
    // 使用 exec() ，因为没有结果返回
    $conn->exec($sql);
    echo "created successfully<br>";
    }
catch(PDOException $e)
    {
    echo $sql . "<br>" . $e->getMessage();
    }

$conn = null;
?>